package com.ganbo.stock.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import org.apache.commons.lang3.StringUtils;


@AllArgsConstructor
public enum OrderType {


    DAY("td", "日涨幅"),
    WEEK("1w", "近一周"),
    MONTH1("1m", "近一月"),
    MONTH3("3m", "近三月"),
    MONTH6("6m", "近六月");

    @Getter
    private String code;
    @Getter
    private String desc;

    public static String findDescByCode(String code) {
        for (OrderType status : values()) if (status.getCode().equals(code)) return status.getDesc();
        return StringUtils.EMPTY;
    }

}
